package test.java.InterfaceTest.DNASession;

import A_I.MPE.MAQPVDCOISIV.full.FullDNATokenPDI;
import S_A.SVQ.stable.S_Common;
import S_logger.Log;
/*
 * 个人著作权人, 作者 罗瑶光, 浏阳
 * yaoguangluo@outlook.com, 313699483@qq.com, 2080315360@qq.com,
 *  （lyg.tin@gmail.com2018年后因G网屏蔽不再使用）
 ** 15116110525-浏阳德塔软件开发有限公司-创始人-法人-总经理-永久非盈利-
 * 430181198505250014, G24402609, EB0581342
 * 204925063, 389418686, F2406501, 0626136
 * 湖南省 浏阳市 集里街道 神仙坳社区 大塘冲路一段
 *  208号 阳光家园别墅小区 第十栋别墅 第三层
 * */
//注意: 该 文件对应的是罗瑶光先生 DNA 编码 与 计算的两本  国家软著作 思想的编码 实现. 
//公安部 与 知识产权委员会 已经备案, 可阅读 相关 著作权 原文  进行逻辑辨别.
//模拟数据新陈代谢, 先从分离main函数开始, 方便以后变成测试函数.
public class FullDNATokenPDITest {
	public static void main(String[] argv) {
		FullDNATokenPDI pDE_RNA_FullFormular = new FullDNATokenPDI();
		String a = "luoyaoguang";
		pDE_RNA_FullFormular.encodeDNA(a);

		@SuppressWarnings("unused")
		String initonKeys = "EIU/0.6/EDU/0.4/si/0.3/sq/0.7/EIU/0.5/EDU/0.5/si"
			+ "/0.632/sq/0.368";
		pDE_RNA_FullFormular.key[0] = 0.6;
		pDE_RNA_FullFormular.key[1] = 0.3;
		pDE_RNA_FullFormular.key[2] = 0.5;
		pDE_RNA_FullFormular.key[3] = 0.632;

		pDE_RNA_FullFormular.text = "控制吸收";
		pDE_RNA_FullFormular.pdw = pDE_RNA_FullFormular.initonSect(
			pDE_RNA_FullFormular.text);
		S_logger.Log.logger.info("" + "原文: " + pDE_RNA_FullFormular.text);
		//pDE_RNA_FullFormular.pdw= "字典保密：MSIOCUOCIPCUPCI";
		String[] lock = new String[12];
		lock[0] = "A";
		lock[3] = "O";
		lock[6] = "P";
		lock[9] = "M";
		lock[1] = "V";
		lock[4] = "E";
		lock[7] = "C";
		lock[10] = "S";
		lock[2] = "I";
		lock[5] = "D";
		lock[8] = "U";
		lock[11] = "Q";
		int i = (int) (Math.random() * 12) % 12;
		pDE_RNA_FullFormular.lock += lock[i];
		i = (int) (Math.random() * 12) % 12;
		pDE_RNA_FullFormular.lock += lock[i];
		i = (int) (Math.random() * 12) % 12;
		pDE_RNA_FullFormular.lock += lock[i];
		i = (int) (Math.random() * 12) % 12;
		pDE_RNA_FullFormular.lock += lock[i];

		for (i = 0; i < pDE_RNA_FullFormular.pdw.length(); i++) {
			pDE_RNA_FullFormular.code += pDE_RNA_FullFormular.lock
				+ pDE_RNA_FullFormular.pdw.charAt(i);
		}
		S_logger.Log.logger.info("" + "肽语: " + pDE_RNA_FullFormular.pdw);
		S_logger.Log.logger.info("" + "肽锁: " + pDE_RNA_FullFormular.lock);
		S_logger.Log.logger.info("" + "散列肽语:" + pDE_RNA_FullFormular.code);
		pDE_RNA_FullFormular.bys = "0.6/0.3/0.5/0.632";
		S_logger.Log.logger.info("" + "静态密钥: " + pDE_RNA_FullFormular.bys);
		pDE_RNA_FullFormular.doKeyPress(pDE_RNA_FullFormular.code,
			pDE_RNA_FullFormular, false);
		S_logger.Log.logger.info("" + "静态肽展降元概率钥匙E: "
			+ pDE_RNA_FullFormular.pdedeKey);
		S_logger.Log.logger.info("" + "静态肽展降元概率钥匙S: "
			+ pDE_RNA_FullFormular.pdedsKey);
		S_logger.Log.logger.info("" + "静态肽展降元: " + pDE_RNA_FullFormular.pds);

		S_logger.Log.logger.info("" + "静态肽展增元概率钥匙E: "
			+ pDE_RNA_FullFormular.pdeieKey);
		S_logger.Log.logger.info("" + "静态肽展增元概率钥匙S: "
			+ pDE_RNA_FullFormular.pdeisKey);
		S_logger.Log.logger.info("" + "静态肽展增元: " + pDE_RNA_FullFormular.pde);

		pDE_RNA_FullFormular.time = "" + System.currentTimeMillis();
		pDE_RNA_FullFormular.cacheId = "ID" + Math.random()
			+ S_Common.STRING_SYMBOL_PER + Math.random();
		S_logger.Log.logger.info("" + "时间:  " + pDE_RNA_FullFormular.time);
		S_logger.Log.logger.info("" + "账号随机缓存字符串:  "
			+ pDE_RNA_FullFormular.cacheId);
		pDE_RNA_FullFormular.session_key = pDE_RNA_FullFormular.pde;
		S_logger.Log.logger.info("" + "Session: "
			+ pDE_RNA_FullFormular.session_key);
		S_logger.Log.logger.info("" + 
			"====================================================");
		S_logger.Log.logger.info("" + "开始前序验证：");
		S_logger.Log.logger.info("" + "开始Session解析： "
			+ pDE_RNA_FullFormular.session_key);
		S_logger.Log.logger.info("" + "开始概率钥匙解析：" + pDE_RNA_FullFormular.pdedeKey
			+ pDE_RNA_FullFormular.pdedsKey
			+ pDE_RNA_FullFormular.pdeieKey
			+ pDE_RNA_FullFormular.pdeisKey);

		FullDNATokenPDI pDE_RNA_FullFormular1 = new FullDNATokenPDI();
		pDE_RNA_FullFormular1.pdedeKey = pDE_RNA_FullFormular.pdedeKey
			.toString();
		pDE_RNA_FullFormular1.pdedsKey = pDE_RNA_FullFormular.pdedsKey
			.toString();
		pDE_RNA_FullFormular1.pdeieKey = pDE_RNA_FullFormular.pdeieKey
			.toString();
		pDE_RNA_FullFormular1.pdeisKey = pDE_RNA_FullFormular.pdeisKey
			.toString();

		pDE_RNA_FullFormular.doKeyUnPress(pDE_RNA_FullFormular.code,
			pDE_RNA_FullFormular1, true);
		S_logger.Log.logger.info("" + "");
		S_logger.Log.logger.info("" + "得到原降元元基DNA序列："
			+ pDE_RNA_FullFormular.pds);
		S_logger.Log.logger.info("" + "得到新降元元基DNA序列："
			+ pDE_RNA_FullFormular1.pds);
		S_logger.Log.logger.info("" + "得到原元基DNA序列：" + pDE_RNA_FullFormular.pde);
		S_logger.Log.logger.info("" + "得到新元基DNA序列：" + pDE_RNA_FullFormular1.pde);
		S_logger.Log.logger.info("" + "验证正确？");
		S_logger.Log.logger.info(pDE_RNA_FullFormular.pde.equals(
			pDE_RNA_FullFormular1.pde) ? "正确" : "失败");
		S_logger.Log.logger.info("" + 
			"========================================================");
		S_logger.Log.logger.info("" + "开始后序验证：");
		FullDNATokenPDI pDE_RNA_FullFormular2 = new FullDNATokenPDI();
		pDE_RNA_FullFormular2.pdeieKey = pDE_RNA_FullFormular.pdedeKey
			.toString();
		pDE_RNA_FullFormular2.pdeisKey = pDE_RNA_FullFormular.pdedsKey
			.toString();
		pDE_RNA_FullFormular2.pdedeKey = pDE_RNA_FullFormular.pdeieKey
			.toString();
		pDE_RNA_FullFormular2.pdedsKey = pDE_RNA_FullFormular.pdeisKey
			.toString();
		S_logger.Log.logger.info("" + "准备计算元基DNA序列："
			+ pDE_RNA_FullFormular1.pde);
		pDE_RNA_FullFormular2.doSessionKeyUnPress(
			pDE_RNA_FullFormular1.pde, pDE_RNA_FullFormular2, true);
		S_logger.Log.logger.info("" + "");
		S_logger.Log.logger.info("" + "得到原续降元元基DNA序列："
			+ pDE_RNA_FullFormular1.pds);
		S_logger.Log.logger.info("" + "得到后续降元元基DNA序列："
			+ pDE_RNA_FullFormular2.pds);
		S_logger.Log.logger.info("" + "验证正确？");
		S_logger.Log.logger.info(pDE_RNA_FullFormular1.pds.equals(
			pDE_RNA_FullFormular2.pds) ? "正确" : "失败");

		S_logger.Log.logger.info("" + 
			"====================================================");
		S_logger.Log.logger.info("" + "开始整序验证：");
		FullDNATokenPDI pDE_RNA_FullFormular3 = new FullDNATokenPDI();

		pDE_RNA_FullFormular3.pdeieKey = pDE_RNA_FullFormular.pdeieKey
			.toString();
		pDE_RNA_FullFormular3.pdeisKey = pDE_RNA_FullFormular.pdeisKey
			.toString();
		pDE_RNA_FullFormular3.pdedeKey = pDE_RNA_FullFormular.pdeieKey
			.toString();
		pDE_RNA_FullFormular3.pdedsKey = pDE_RNA_FullFormular.pdeisKey
			.toString();

		S_logger.Log.logger.info("" + "准备计算元基DNA序列："
			+ pDE_RNA_FullFormular1.pde);//pde加成
		pDE_RNA_FullFormular3.doFullSessionKeyUnPress(
			pDE_RNA_FullFormular1.pde, pDE_RNA_FullFormular3, true);
		S_logger.Log.logger.info("" + "");
		S_logger.Log.logger.info("" + "得到原续降元元基DNA序列："
			+ pDE_RNA_FullFormular1.pds);
		S_logger.Log.logger.info("" + "得到后续降元元基DNA序列："
			+ pDE_RNA_FullFormular3.pds);
		S_logger.Log.logger.info("" + "验证正确？");
		S_logger.Log.logger.info(pDE_RNA_FullFormular1.pds.equals(
			pDE_RNA_FullFormular3.pds) ? "正确" : "失败");
		S_logger.Log.logger.info("" + "准备整序计算元基DNA序列："
			+ pDE_RNA_FullFormular1.pde);
		S_logger.Log.logger.info("" + "准备整序计算元基DNA序列："
			+ pDE_RNA_FullFormular3.pde);
		S_logger.Log.logger.info(pDE_RNA_FullFormular1.pde.equals(
			pDE_RNA_FullFormular3.pde) ? "正确" : "失败");
	}
}
//输出测试
//Connected to the target VM, address: '127.0.0.1:53114', transport: 'socket'
//原文: 控制吸收
//肽语: PEEOOUPOAVCUPOECAUPEDOAU
//肽锁: AMQS
//散列肽语:AMQSPAMQSEAMQSEAMQSOAMQSOAMQSUAMQSPAMQSOAMQSAAMQSVAMQSCAMQSUAMQSPA
//MQSOAMQSEAMQSCAMQSAAMQSUAMQSPAMQSEAMQSDAMQSOAMQSAAMQSU
//静态密钥: 0.6/0.3/0.5/0.632
//静态肽展降元概率钥匙E: 1111011100101
//静态肽展降元概率钥匙S: 11110011111001110110010111101110011110101111110101110
//111001111011000000111100000
//静态肽展降元: UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUUQI
//IDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQI
//DQQQDIUQQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIID
//IQQUQUQQIDQQIUQIUQIIDIQIU
//静态肽展增元概率钥匙E: 0100101010001010000000101000000000101000000001
//静态肽展增元概率钥匙S: 101110100101011110110010111010110001100101110011110001110111
//000110101110101110100111011001011100011110110010110000100001110110000010
//静态肽展增元: ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVASOSS
//SEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSSAA
//SOSSE
//时间:  1755568223215
//账号随机缓存字符串:  ID0.36524081945678744:0.6843533604657223
//Session: ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVASOSSSEA
//SOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSSAASOSSE
//====================================================
//开始前序验证：
//开始Session解析： ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVAS
//OSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSSA
//ASOSSE
//开始概率钥匙解析：11110111001011111001111100111011001011110111001111010111111010111
//01110011110110000001111000000100101010001010000000101000000000101000000001101110
//1001010111101100101110101100011001011100111100011101110001101011101011101001110
//11001011100011110110010110000100001110110000010
//
//得到原降元元基DNA序列：UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUUQI
//IDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQIDQQQDIU
//QQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIIDIQQUQUQQ
//IDQQIUQIUQIIDIQIU
//得到新降元元基DNA序列：UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUUQI
//IDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQIDQQQDIU
//QQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIIDIQQUQUQQ
//IDQQIUQIUQIIDIQIU
//得到原元基DNA序列：ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVAS
//OSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSSA
//ASOSSE
//得到新元基DNA序列：ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVAS
//OSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSSA
//ASOSSE
//验证正确？
//正确
//========================================================
//开始后序验证：
//准备计算元基DNA序列：ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVA
//SOSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSSA
//ASOSSE
//
//得到原续降元元基DNA序列：UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUUQ
//IIDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQIDQQQDIU
//QQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIIDIQQUQUQQI
//DQQIUQIUQIIDIQIU
//得到后续降元元基DNA序列：UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUUQ
//IIDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQIDQQQDIU
//QQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIIDIQQUQUQQI
//DQQIUQIUQIIDIQIU
//验证正确？
//正确
//====================================================
//开始整序验证：
//准备计算元基DNA序列：ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASOSSVA
//SOSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVASOSS
//AASOSSE
//
//得到原续降元元基DNA序列：UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUU
//QIIDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQIDQQQD
//IUQQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIIDIQQUQU
//QQIDQQIUQIUQIIDIQIU
//得到后续降元元基DNA序列：UQQIDQQQUIDUQQIDIQIUUQQIDQQQUUQQIDQQIUIUQQIDQQQDIUQQIDQQIUU
//QIIDQQIUIDUQQIDQQQUQUQIIDQQQUQQUQIIDIQQUQUQQIDQQQIDUQIIDQQIUUQQIDQQQUIDUQQIDQQQD
//IUQQIDIQQDUQQIDQQIIDUQQIDQQQUQIUQIIDQQQUUQQIDQQIUIDUQQIDQQIDUQIIDIQIDUQIIDIQQUQU
//QQIDQQIUQIUQIIDIQIU
//验证正确？
//正确
//准备整序计算元基DNA序列：ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASO
//SSVASOSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVA
//SOSSAASOSSE
//准备整序计算元基DNA序列：ASOSSOEASOSSEASOSSEASOSSOASOSSOASOSSEASOSSOEASOSSVASOSSAASO
//SSVASOSSSEASOSSEASOSSOEASOSSOASOSSEASOSSSEASOSSAASOSSEASOSSOEASOSSEASOSSEASOSSVA
//SOSSAASOSSE
//正确
//Disconnected from the target VM, address: '127.0.0.1:53114', transport: 'socket'
//
//Process finished with exit code 0